import axios from "axios"
const request = axios.create({
  baseURL: "/qwer",
  timeout: 200000
})

// 请求拦截器
request.interceptors.request.use((config) => {
  let token=localStorage.getItem('xmtoken')
  if(token){
    config.headers.token=token
  }
  return config
}, (error) => {
  return Promise.reject(error)
})

// 响应拦截器
request.interceptors.response.use((res) => {
  return res.data
}, (error) => {
  return Promise.reject(error)
})


export default request
